<?php
require_once ('model/EditModel.php');
require_once 'view/EditView.php';

class EditController {

	private $model;
	private $view;

	function __construct() {
		$this -> model = new EditModel();
		$this -> view = new EditView();
	}
	
	/**
	 * @return boolean Returns true if the complete attendee list should be shown
	 */
	private function showListOrEdit(){
		return $this -> model -> listOrEdit();
	}

	/**
	 * @return String HTML
	 */
	public function getContent() {
		if($this -> showListOrEdit()){
			return $this -> view -> getListHTML($this -> model -> getAttendeeArray());
		} else {
			return $this -> view -> getEditHTML();
		}
	}

}
